const express = require('express')
const parser = require("body-parser");
const app = express();
const fs = require("fs");//静态资源
const port = 3000



app.use(parser.json());

app.get('/', (req, res) => {
  console.log(req.query);
  res.send('<h1>Hello World!</h1>')
})
app.post('/index', (req, res) => {
  console.log(req.body);
  res.send('<h1>Hello World!</h1>')
})
// 文件加载
fs.readFile("./a.txt",(err,res)=>{
  if(err){
    console.log(err);
  }else{
    console.log(res.toString());
  }
})
console.log("over");
console.log(process.cwd());
console.log(process.argv);
app.listen(port, () => {
  console.log(`Example app listening at http://localhost:${port}`)
})